class CreateAddresses < ActiveRecord::Migration
  def self.up
    remove_column :councillors, :address
    add_column :councillors, :address_id, :integer
    
    create_table :addresses do |t|
      t.column :address_id, :integer
      t.column :line_1, :string
      t.column :line_2, :string
      t.column :line_3, :string
      t.column :line_4, :string
      t.column :post_code, :string
      t.timestamps
    end
  end

  def self.down
    drop_table :addresses
    add_column :councillors, :address, :text
    remove_column :councillors, :address_id
  end
end
